﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LuShanTea.Admin.Web.App_Start
{
    public class LuShanTeaExceptionFilter : IExceptionFilter
    {
        private static ILog log = LogManager.GetLogger(typeof(LuShanTeaExceptionFilter));

        public void OnException(ExceptionContext filterContext)
        {
            log.Error("出现未处理异常", filterContext.Exception);
            //TODO:项目结束时加上
            filterContext.ExceptionHandled = true;
            var content = new ContentResult();
            content.Content = "500系统错误";
            filterContext.Result = content;
        }
    }
}